/*
 * @Author: your name
 * @Date: 2020-07-24 08:59:05
 * @LastEditTime: 2020-07-24 11:45:30
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \truck\platform\uuid\prefix.h
 */

#ifndef TB_PREFIX_TYPE_H
#define TB_PREFIX_TYPE_H

#include "stdio.h"
#include "string.h"
#include <sys/time.h>
#include <unistd.h>
#include <stdlib.h>
#ifdef __cplusplus
#   define __tb_extern_c__                      extern "C"
#   define __tb_extern_c_enter__                extern "C" {
#   define __tb_extern_c_leave__                }
#else
#   define __tb_extern_c__
#   define __tb_extern_c_enter__
#   define __tb_extern_c_leave__
#endif

// null
#ifdef __cplusplus
#   define tb_null                  (0)
#else
#   define tb_null                  ((tb_pointer_t)0)
#endif
// check
#define tb_check_return(x)                              do { if (!(x)) return ; } while (0)
#define tb_check_return_val(x, v)                       do { if (!(x)) return (v); } while (0)

#define tb_assert(x)                                     tb_assert_empty_impl()
#define tb_assert_and_check_abort(x)                     tb_check_abort(x)
#define tb_assert_and_check_return(x)                    tb_check_return(x)
#define tb_assert_and_check_return_val(x, v)             tb_check_return_val(x, v)
#define tb_assert_and_check_goto(x, b)                   tb_check_goto(x, b)
#define tb_assert_and_check_break(x)                     tb_check_break(x)
#define tb_assert_and_check_continue(x)                  tb_check_continue(x)
#define tb_assert_and_check_break_state(x, s, v)         tb_check_break_state(x, s, v)


#define tb_true                     ((tb_bool_t)1)
#define tb_false                    ((tb_bool_t)0)

// basic
typedef signed int                  tb_int_t;
typedef unsigned int                tb_uint_t;
typedef signed short                tb_short_t;
typedef unsigned short              tb_ushort_t;
typedef tb_int_t                    tb_bool_t;
typedef signed char                 tb_int8_t;
typedef tb_int8_t                   tb_sint8_t;
typedef unsigned char               tb_uint8_t;
typedef tb_short_t                  tb_int16_t;
typedef tb_int16_t                  tb_sint16_t;
typedef tb_ushort_t                 tb_uint16_t;
typedef tb_int_t                    tb_int32_t;
typedef tb_int32_t                  tb_sint32_t;
typedef tb_uint_t                   tb_uint32_t;
typedef char                        tb_char_t;
typedef unsigned char               tb_uchar_t;
typedef tb_uint8_t                  tb_byte_t;
typedef void                        tb_void_t;
typedef tb_void_t*                  tb_pointer_t;
typedef tb_void_t const*            tb_cpointer_t;
typedef tb_pointer_t                tb_handle_t;

typedef signed long long            tb_int64_t;
typedef unsigned long long          tb_uint64_t;

typedef tb_int64_t                  tb_sint64_t;

// hong and hize
typedef tb_sint64_t                 tb_hong_t;
typedef tb_uint64_t                 tb_hize_t;

typedef signed long                 tb_long_t;
typedef unsigned long               tb_ulong_t;
typedef tb_ulong_t                  tb_size_t;

#endif